import request from '@/utils/request'
import url from './url'

export function createWorkApi(data) {
  return request({
    url: url.createWorkUrl,
    method: 'post',
    data
  })
}

export function updateWorkApi(data) {
  return request({
    url: url.updateWorkUrl,
    method: 'post',
    data
  })
}

export function deleteWorkApi(data) {
  return request({
    url: url.deleteWorkUrl,
    method: 'post',
    data
  })
}

export function runWorkApi(host, data) {
  const u = 'http://' + host + ':18000' + url.runWorkUrl
  return request({
    url: u,
    method: 'post',
    data
  })
}

export function getWorkListApi(data) {
  return request({
    url: url.getWorkListUrl,
    method: 'get',
    params: data
  })
}

export function getWorkerListApi(data) {
  return request({
    url: url.getWorkerListUrl,
    method: 'get',
    params: data
  })
}

export function deleteWorkerApi(data) {
  return request({
    url: url.deleteWorkerUrl,
    method: 'post',
    data
  })
}

export function getWorkApi(data) {
  return request({
    url: url.getWorkUrl,
    method: 'get',
    params: data
  })
}

export function getWorkBaseInfoApi(data) {
  return request({
    url: url.getWorkBaseInfoUrl,
    method: 'get',
    params: data
  })
}
